<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/* x509-1.1.20.js (c) 2012-2018 Kenji Urushima | kjur.github.io/jsrsasign/license
<span class='line'>  2</span>  */</span><span class="WHIT">
<span class='line'>  3</span> </span><span class="COMM">/*
<span class='line'>  4</span>  * x509.js - X509 class to read subject public key from certificate.
<span class='line'>  5</span>  *
<span class='line'>  6</span>  * Copyright (c) 2010-2018 Kenji Urushima (kenji.urushima@gmail.com)
<span class='line'>  7</span>  *
<span class='line'>  8</span>  * This software is licensed under the terms of the MIT License.
<span class='line'>  9</span>  * https://kjur.github.io/jsrsasign/license
<span class='line'> 10</span>  *
<span class='line'> 11</span>  * The above copyright and license notice shall be
<span class='line'> 12</span>  * included in all copies or substantial portions of the Software.
<span class='line'> 13</span>  */</span><span class="WHIT">
<span class='line'> 14</span> 
<span class='line'> 15</span> </span><span class="COMM">/**
<span class='line'> 16</span>  * @fileOverview
<span class='line'> 17</span>  * @name x509-1.1.js
<span class='line'> 18</span>  * @author Kenji Urushima kenji.urushima@gmail.com
<span class='line'> 19</span>  * @version jsrsasign 8.0.10 x509 1.1.20 (2018-Apr-09)
<span class='line'> 20</span>  * @since jsrsasign 1.x.x
<span class='line'> 21</span>  * @license &lt;a href="https://kjur.github.io/jsrsasign/license/">MIT License&lt;/a>
<span class='line'> 22</span>  */</span><span class="WHIT">
<span class='line'> 23</span> 
<span class='line'> 24</span> </span><span class="COMM">/**
<span class='line'> 25</span>  * hexadecimal X.509 certificate ASN.1 parser class.&lt;br/>
<span class='line'> 26</span>  * @class hexadecimal X.509 certificate ASN.1 parser class
<span class='line'> 27</span>  * @property {String} hex hexacedimal string for X.509 certificate.
<span class='line'> 28</span>  * @property {Number} version format version (1: X509v1, 3: X509v3, otherwise: unknown) since jsrsasign 7.1.4
<span class='line'> 29</span>  * @author Kenji Urushima
<span class='line'> 30</span>  * @version 1.0.1 (08 May 2012)
<span class='line'> 31</span>  * @see &lt;a href="https://kjur.github.io/jsrsasigns/">'jsrsasign'(RSA Sign JavaScript Library) home page https://kjur.github.io/jsrsasign/&lt;/a>
<span class='line'> 32</span>  * @description
<span class='line'> 33</span>  * X509 class provides following functionality:
<span class='line'> 34</span>  * &lt;ul>
<span class='line'> 35</span>  * &lt;li>parse X.509 certificate ASN.1 structure&lt;/li>
<span class='line'> 36</span>  * &lt;li>get basic fields, extensions, signature algorithms and signature values&lt;/li>
<span class='line'> 37</span>  * &lt;li>read PEM certificate&lt;/li>
<span class='line'> 38</span>  * &lt;/ul>
<span class='line'> 39</span>  *
<span class='line'> 40</span>  * &lt;ul>
<span class='line'> 41</span>  * &lt;li>&lt;b>TO GET FIELDS&lt;/b>
<span class='line'> 42</span>  *   &lt;ul>
<span class='line'> 43</span>  *   &lt;li>serial - {@link X509#getSerialNumberHex}&lt;/li>
<span class='line'> 44</span>  *   &lt;li>signature algorithm field - {@link X509#getSignatureAlgorithmField}&lt;/li>
<span class='line'> 45</span>  *   &lt;li>issuer - {@link X509#getIssuerHex}&lt;/li>
<span class='line'> 46</span>  *   &lt;li>issuer - {@link X509#getIssuerString}&lt;/li>
<span class='line'> 47</span>  *   &lt;li>notBefore - {@link X509#getNotBefore}&lt;/li>
<span class='line'> 48</span>  *   &lt;li>notAfter - {@link X509#getNotAfter}&lt;/li>
<span class='line'> 49</span>  *   &lt;li>subject - {@link X509#getSubjectHex}&lt;/li>
<span class='line'> 50</span>  *   &lt;li>subject - {@link X509#getSubjectString}&lt;/li>
<span class='line'> 51</span>  *   &lt;li>subjectPublicKeyInfo - {@link X509#getPublicKey}&lt;/li>
<span class='line'> 52</span>  *   &lt;li>subjectPublicKeyInfo - {@link X509#getPublicKeyHex}&lt;/li>
<span class='line'> 53</span>  *   &lt;li>subjectPublicKeyInfo - {@link X509#getPublicKeyIdx}&lt;/li>
<span class='line'> 54</span>  *   &lt;li>subjectPublicKeyInfo - {@link X509.getPublicKeyFromCertPEM}&lt;/li>
<span class='line'> 55</span>  *   &lt;li>subjectPublicKeyInfo - {@link X509.getPublicKeyFromCertHex}&lt;/li>
<span class='line'> 56</span>  *   &lt;li>subjectPublicKeyInfo - {@link X509#getPublicKeyContentIdx}&lt;/li>
<span class='line'> 57</span>  *   &lt;li>signature algorithm - {@link X509#getSignatureAlgorithmName}&lt;/li>
<span class='line'> 58</span>  *   &lt;li>signature value - {@link X509#getSignatureValueHex}&lt;/li>
<span class='line'> 59</span>  *   &lt;/ul>
<span class='line'> 60</span>  * &lt;/li>
<span class='line'> 61</span>  * &lt;li>&lt;b>X509 METHODS TO GET EXTENSIONS&lt;/b>
<span class='line'> 62</span>  *   &lt;ul>
<span class='line'> 63</span>  *   &lt;li>basicConstraints - {@link X509#getExtBasicConstraints}&lt;/li>
<span class='line'> 64</span>  *   &lt;li>keyUsage - {@link X509#getExtKeyUsageBin}&lt;/li>
<span class='line'> 65</span>  *   &lt;li>keyUsage - {@link X509#getExtKeyUsageString}&lt;/li>
<span class='line'> 66</span>  *   &lt;li>subjectKeyIdentifier - {@link X509#getExtSubjectKeyIdentifier}&lt;/li>
<span class='line'> 67</span>  *   &lt;li>authorityKeyIdentifier - {@link X509#getExtAuthorityKeyIdentifier}&lt;/li>
<span class='line'> 68</span>  *   &lt;li>extKeyUsage - {@link X509#getExtExtKeyUsageName}&lt;/li>
<span class='line'> 69</span>  *   &lt;li>subjectAltName(DEPRECATED) - {@link X509#getExtSubjectAltName}&lt;/li>
<span class='line'> 70</span>  *   &lt;li>subjectAltName2 - {@link X509#getExtSubjectAltName2}&lt;/li>
<span class='line'> 71</span>  *   &lt;li>cRLDistributionPoints - {@link X509#getExtCRLDistributionPointsURI}&lt;/li>
<span class='line'> 72</span>  *   &lt;li>authorityInfoAccess - {@link X509#getExtAIAInfo}&lt;/li>
<span class='line'> 73</span>  *   &lt;li>certificatePolicies - {@link X509#getExtCertificatePolicies}&lt;/li>
<span class='line'> 74</span>  *   &lt;/ul>
<span class='line'> 75</span>  * &lt;/li>
<span class='line'> 76</span>  * &lt;li>&lt;b>UTILITIES&lt;/b>
<span class='line'> 77</span>  *   &lt;ul>
<span class='line'> 78</span>  *   &lt;li>reading PEM X.509 certificate - {@link X509#readCertPEM}&lt;/li>
<span class='line'> 79</span>  *   &lt;li>reading hexadecimal string of X.509 certificate - {@link X509#readCertHex}&lt;/li>
<span class='line'> 80</span>  *   &lt;li>get all certificate information - {@link X509#getInfo}&lt;/li>
<span class='line'> 81</span>  *   &lt;li>get specified extension information - {@link X509#getExtInfo}&lt;/li>
<span class='line'> 82</span>  *   &lt;li>verify signature value - {@link X509#verifySignature}&lt;/li>
<span class='line'> 83</span>  *   &lt;/ul>
<span class='line'> 84</span>  * &lt;/li>
<span class='line'> 85</span>  * &lt;/ul>
<span class='line'> 86</span>  */</span><span class="WHIT">
<span class='line'> 87</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 88</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 89</span> </span><span class="WHIT">	</span><span class="NAME">_getChildIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 90</span> </span><span class="WHIT">	</span><span class="NAME">_getV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getV</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 91</span> </span><span class="WHIT">	</span><span class="NAME">_getTLV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLV</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 92</span> </span><span class="WHIT">	</span><span class="NAME">_getVbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVbyList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 93</span> </span><span class="WHIT">	</span><span class="NAME">_getTLVbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLVbyList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 94</span> </span><span class="WHIT">	</span><span class="NAME">_getIdxbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getIdxbyList</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 95</span> </span><span class="WHIT">	</span><span class="NAME">_getVidx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVidx</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 96</span> </span><span class="WHIT">	</span><span class="NAME">_oidname</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.oidname</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 97</span> </span><span class="WHIT">	</span><span class="NAME">_X509</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'> 98</span> </span><span class="WHIT">	</span><span class="NAME">_pemtohex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">pemtohex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 99</span> 
<span class='line'>100</span> </span><span class="WHIT">    </span><span class="NAME">this.hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>101</span> </span><span class="WHIT">    </span><span class="NAME">this.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// version (1: X509v1, 3: X509v3, others: unspecified)</span><span class="WHIT">
<span class='line'>102</span> </span><span class="WHIT">    </span><span class="NAME">this.foffset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// field index offset (-1: for X509v1, 0: for X509v3)</span><span class="WHIT">
<span class='line'>103</span> </span><span class="WHIT">    </span><span class="NAME">this.aExtInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>104</span> 
<span class='line'>105</span> </span><span class="WHIT">    </span><span class="COMM">// ===== get basic fields from hex =====================================</span><span class="WHIT">
<span class='line'>106</span> 
<span class='line'>107</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>108</span>      * get format version (X.509v1 or v3 certificate)&lt;br/>
<span class='line'>109</span>      * @name getVersion
<span class='line'>110</span>      * @memberOf X509#
<span class='line'>111</span>      * @function
<span class='line'>112</span>      * @return {Number} 1 for X509v1, 3 for X509v3, otherwise 0
<span class='line'>113</span>      * @since jsrsasign 7.1.14 x509 1.1.13
<span class='line'>114</span>      * @description
<span class='line'>115</span>      * This method returns a format version of X.509 certificate.
<span class='line'>116</span>      * It returns 1 for X.509v1 certificate and 3 for v3 certificate.
<span class='line'>117</span>      * Otherwise returns 0.
<span class='line'>118</span>      * This method will be automatically called in
<span class='line'>119</span>      * {@link X509#readCertPEM}. After then, you can use
<span class='line'>120</span>      * {@link X509.version} parameter.
<span class='line'>121</span>      * @example
<span class='line'>122</span>      * var x = new X509();
<span class='line'>123</span>      * x.readCertPEM(sCertPEM);
<span class='line'>124</span>      * version = x.getVersion();    // 1 or 3
<span class='line'>125</span>      * sn = x.getSerialNumberHex(); // return string like "01ad..."
<span class='line'>126</span>      */</span><span class="WHIT">
<span class='line'>127</span> </span><span class="WHIT">    </span><span class="NAME">this.getVersion</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>128</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">this.version</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.version</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>129</span> 
<span class='line'>130</span> </span><span class="WHIT">	</span><span class="COMM">// check if the first item of tbsCertificate "[0] { INTEGER 2 }"</span><span class="WHIT">
<span class='line'>131</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">_getTLVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT">
<span class='line'>132</span> </span><span class="WHIT">	    </span><span class="STRN">"a003020102"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>133</span> </span><span class="WHIT">	    </span><span class="NAME">this.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>134</span> </span><span class="WHIT">	    </span><span class="NAME">this.foffset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>135</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>136</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>137</span> 
<span class='line'>138</span> </span><span class="WHIT">	</span><span class="NAME">this.version</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>139</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>140</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>141</span> 
<span class='line'>142</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>143</span>      * get hexadecimal string of serialNumber field of certificate.&lt;br/>
<span class='line'>144</span>      * @name getSerialNumberHex
<span class='line'>145</span>      * @memberOf X509#
<span class='line'>146</span>      * @function
<span class='line'>147</span>      * @return {String} hexadecimal string of certificate serial number
<span class='line'>148</span>      * @example
<span class='line'>149</span>      * var x = new X509();
<span class='line'>150</span>      * x.readCertPEM(sCertPEM);
<span class='line'>151</span>      * var sn = x.getSerialNumberHex(); // return string like "01ad..."
<span class='line'>152</span>      */</span><span class="WHIT">
<span class='line'>153</span> </span><span class="WHIT">    </span><span class="NAME">this.getSerialNumberHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>154</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.foffset</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"02"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>155</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>156</span> 
<span class='line'>157</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>158</span>      * get signature algorithm name in basic field
<span class='line'>159</span>      * @name getSignatureAlgorithmField
<span class='line'>160</span>      * @memberOf X509#
<span class='line'>161</span>      * @function
<span class='line'>162</span>      * @return {String} signature algorithm name (ex. SHA1withRSA, SHA256withECDSA)
<span class='line'>163</span>      * @since x509 1.1.8
<span class='line'>164</span>      * @description
<span class='line'>165</span>      * This method will get a name of signature algorithm field of certificate:
<span class='line'>166</span>      * @example
<span class='line'>167</span>      * var x = new X509();
<span class='line'>168</span>      * x.readCertPEM(sCertPEM);
<span class='line'>169</span>      * algName = x.getSignatureAlgorithmField();
<span class='line'>170</span>      */</span><span class="WHIT">
<span class='line'>171</span> </span><span class="WHIT">    </span><span class="NAME">this.getSignatureAlgorithmField</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>172</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_oidname</span><span class="PUNC">(</span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.foffset</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>173</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>174</span> 
<span class='line'>175</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>176</span>      * get hexadecimal string of issuer field TLV of certificate.&lt;br/>
<span class='line'>177</span>      * @name getIssuerHex
<span class='line'>178</span>      * @memberOf X509#
<span class='line'>179</span>      * @function
<span class='line'>180</span>      * @return {String} hexadecial string of issuer DN ASN.1
<span class='line'>181</span>      * @example
<span class='line'>182</span>      * var x = new X509();
<span class='line'>183</span>      * x.readCertPEM(sCertPEM);
<span class='line'>184</span>      * var issuer = x.getIssuerHex(); // return string like "3013..."
<span class='line'>185</span>      */</span><span class="WHIT">
<span class='line'>186</span> </span><span class="WHIT">    </span><span class="NAME">this.getIssuerHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>187</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_getTLVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.foffset</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>188</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>189</span> 
<span class='line'>190</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>191</span>      * get string of issuer field of certificate.&lt;br/>
<span class='line'>192</span>      * @name getIssuerString
<span class='line'>193</span>      * @memberOf X509#
<span class='line'>194</span>      * @function
<span class='line'>195</span>      * @return {String} issuer DN string
<span class='line'>196</span>      * @example
<span class='line'>197</span>      * var x = new X509();
<span class='line'>198</span>      * x.readCertPEM(sCertPEM);
<span class='line'>199</span>      * var issuer = x.getIssuerString(); // return string like "/C=US/O=TEST"
<span class='line'>200</span>      */</span><span class="WHIT">
<span class='line'>201</span> </span><span class="WHIT">    </span><span class="NAME">this.getIssuerString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>202</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_X509.hex2dn</span><span class="PUNC">(</span><span class="NAME">this.getIssuerHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>203</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>204</span> 
<span class='line'>205</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>206</span>      * get hexadecimal string of subject field of certificate.&lt;br/>
<span class='line'>207</span>      * @name getSubjectHex
<span class='line'>208</span>      * @memberOf X509#
<span class='line'>209</span>      * @function
<span class='line'>210</span>      * @return {String} hexadecial string of subject DN ASN.1
<span class='line'>211</span>      * @example
<span class='line'>212</span>      * var x = new X509();
<span class='line'>213</span>      * x.readCertPEM(sCertPEM);
<span class='line'>214</span>      * var subject = x.getSubjectHex(); // return string like "3013..."
<span class='line'>215</span>      */</span><span class="WHIT">
<span class='line'>216</span> </span><span class="WHIT">    </span><span class="NAME">this.getSubjectHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>217</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_getTLVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">5</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.foffset</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>218</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>219</span> 
<span class='line'>220</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>221</span>      * get string of subject field of certificate.&lt;br/>
<span class='line'>222</span>      * @name getSubjectString
<span class='line'>223</span>      * @memberOf X509#
<span class='line'>224</span>      * @function
<span class='line'>225</span>      * @return {String} subject DN string
<span class='line'>226</span>      * @example
<span class='line'>227</span>      * var x = new X509();
<span class='line'>228</span>      * x.readCertPEM(sCertPEM);
<span class='line'>229</span>      * var subject = x.getSubjectString(); // return string like "/C=US/O=TEST"
<span class='line'>230</span>      */</span><span class="WHIT">
<span class='line'>231</span> </span><span class="WHIT">    </span><span class="NAME">this.getSubjectString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>232</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_X509.hex2dn</span><span class="PUNC">(</span><span class="NAME">this.getSubjectHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>233</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>234</span> 
<span class='line'>235</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>236</span>      * get notBefore field string of certificate.&lt;br/>
<span class='line'>237</span>      * @name getNotBefore
<span class='line'>238</span>      * @memberOf X509#
<span class='line'>239</span>      * @function
<span class='line'>240</span>      * @return {String} not before time value (ex. "151231235959Z")
<span class='line'>241</span>      * @example
<span class='line'>242</span>      * var x = new X509();
<span class='line'>243</span>      * x.readCertPEM(sCertPEM);
<span class='line'>244</span>      * var notBefore = x.getNotBefore(); // return string like "151231235959Z"
<span class='line'>245</span>      */</span><span class="WHIT">
<span class='line'>246</span> </span><span class="WHIT">    </span><span class="NAME">this.getNotBefore</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>247</span> </span><span class="WHIT">        </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.foffset</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>248</span> </span><span class="WHIT">        </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s.replace</span><span class="PUNC">(</span><span class="REGX">/(..)/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"%$1"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>249</span> </span><span class="WHIT">        </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">decodeURIComponent</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>250</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>251</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>252</span> 
<span class='line'>253</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>254</span>      * get notAfter field string of certificate.&lt;br/>
<span class='line'>255</span>      * @name getNotAfter
<span class='line'>256</span>      * @memberOf X509#
<span class='line'>257</span>      * @function
<span class='line'>258</span>      * @return {String} not after time value (ex. "151231235959Z")
<span class='line'>259</span>      * @example
<span class='line'>260</span>      * var x = new X509();
<span class='line'>261</span>      * x.readCertPEM(sCertPEM);
<span class='line'>262</span>      * var notAfter = x.getNotAfter(); // return string like "151231235959Z"
<span class='line'>263</span>      */</span><span class="WHIT">
<span class='line'>264</span> </span><span class="WHIT">    </span><span class="NAME">this.getNotAfter</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>265</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">4</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.foffset</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>266</span> </span><span class="WHIT">        </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">s.replace</span><span class="PUNC">(</span><span class="REGX">/(..)/g</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"%$1"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>267</span> </span><span class="WHIT">        </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">decodeURIComponent</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>268</span> </span><span class="WHIT">        </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>269</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>270</span> 
<span class='line'>271</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>272</span>      * get a hexadecimal string of subjectPublicKeyInfo field.&lt;br/>
<span class='line'>273</span>      * @name getPublicKeyHex
<span class='line'>274</span>      * @memberOf X509#
<span class='line'>275</span>      * @function
<span class='line'>276</span>      * @return {String} ASN.1 SEQUENCE hexadecimal string of subjectPublicKeyInfo field
<span class='line'>277</span>      * @since jsrsasign 7.1.4 x509 1.1.13
<span class='line'>278</span>      * @example
<span class='line'>279</span>      * x = new X509();
<span class='line'>280</span>      * x.readCertPEM(sCertPEM);
<span class='line'>281</span>      * hSPKI = x.getPublicKeyHex(); // return string like "30820122..."
<span class='line'>282</span>      */</span><span class="WHIT">
<span class='line'>283</span> </span><span class="WHIT">    </span><span class="NAME">this.getPublicKeyHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>284</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getTLVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.foffset</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>285</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>286</span> 
<span class='line'>287</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>288</span>      * get a string index of subjectPublicKeyInfo field for hexadecimal string certificate.&lt;br/>
<span class='line'>289</span>      * @name getPublicKeyIdx
<span class='line'>290</span>      * @memberOf X509#
<span class='line'>291</span>      * @function
<span class='line'>292</span>      * @return {Number} string index of subjectPublicKeyInfo field for hexadecimal string certificate.
<span class='line'>293</span>      * @since jsrsasign 7.1.4 x509 1.1.13
<span class='line'>294</span>      * @example
<span class='line'>295</span>      * x = new X509();
<span class='line'>296</span>      * x.readCertPEM(sCertPEM);
<span class='line'>297</span>      * idx = x.getPublicKeyIdx(); // return string index in x.hex parameter
<span class='line'>298</span>      */</span><span class="WHIT">
<span class='line'>299</span> </span><span class="WHIT">    </span><span class="NAME">this.getPublicKeyIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>300</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_getIdxbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.foffset</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>301</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>302</span> 
<span class='line'>303</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>304</span>      * get a string index of contents of subjectPublicKeyInfo BITSTRING value from hexadecimal certificate&lt;br/>
<span class='line'>305</span>      * @name getPublicKeyContentIdx
<span class='line'>306</span>      * @memberOf X509#
<span class='line'>307</span>      * @function
<span class='line'>308</span>      * @return {Integer} string index of key contents
<span class='line'>309</span>      * @since jsrsasign 8.0.0 x509 1.2.0
<span class='line'>310</span>      * @example
<span class='line'>311</span>      * x = new X509();
<span class='line'>312</span>      * x.readCertPEM(sCertPEM);
<span class='line'>313</span>      * idx = x.getPublicKeyContentIdx(); // return string index in x.hex parameter
<span class='line'>314</span>      */</span><span class="WHIT">
<span class='line'>315</span> </span><span class="WHIT">    </span><span class="COMM">// NOTE: Without BITSTRING encapsulation.</span><span class="WHIT">
<span class='line'>316</span> </span><span class="WHIT">    </span><span class="NAME">this.getPublicKeyContentIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>317</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getPublicKeyIdx</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>318</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_getIdxbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>319</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>320</span> 
<span class='line'>321</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>322</span>      * get a RSAKey/ECDSA/DSA public key object of subjectPublicKeyInfo field.&lt;br/>
<span class='line'>323</span>      * @name getPublicKey
<span class='line'>324</span>      * @memberOf X509#
<span class='line'>325</span>      * @function
<span class='line'>326</span>      * @return {Object} RSAKey/ECDSA/DSA public key object of subjectPublicKeyInfo field
<span class='line'>327</span>      * @since jsrsasign 7.1.4 x509 1.1.13
<span class='line'>328</span>      * @example
<span class='line'>329</span>      * x = new X509();
<span class='line'>330</span>      * x.readCertPEM(sCertPEM);
<span class='line'>331</span>      * pubkey= x.getPublicKey();
<span class='line'>332</span>      */</span><span class="WHIT">
<span class='line'>333</span> </span><span class="WHIT">    </span><span class="NAME">this.getPublicKey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>334</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">KEYUTIL.getKey</span><span class="PUNC">(</span><span class="NAME">this.getPublicKeyHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"pkcs8pub"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>335</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>336</span> 
<span class='line'>337</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>338</span>      * get signature algorithm name from hexadecimal certificate data
<span class='line'>339</span>      * @name getSignatureAlgorithmName
<span class='line'>340</span>      * @memberOf X509#
<span class='line'>341</span>      * @function
<span class='line'>342</span>      * @param {String} hCert hexadecimal string of X.509 certificate binary
<span class='line'>343</span>      * @return {String} signature algorithm name (ex. SHA1withRSA, SHA256withECDSA)
<span class='line'>344</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>345</span>      * @description
<span class='line'>346</span>      * This method will get signature algorithm name of certificate:
<span class='line'>347</span>      * @example
<span class='line'>348</span>      * var x = new X509();
<span class='line'>349</span>      * x.readCertPEM(sCertPEM);
<span class='line'>350</span>      * x.getSignatureAlgorithmName() &rarr; "SHA256withRSA"
<span class='line'>351</span>      */</span><span class="WHIT">
<span class='line'>352</span> </span><span class="WHIT">    </span><span class="NAME">this.getSignatureAlgorithmName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>353</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_oidname</span><span class="PUNC">(</span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>354</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>355</span> 
<span class='line'>356</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>357</span>      * get signature value in hexadecimal string&lt;br/>
<span class='line'>358</span>      * @name getSignatureValueHex
<span class='line'>359</span>      * @memberOf X509#
<span class='line'>360</span>      * @function
<span class='line'>361</span>      * @return {String} signature value hexadecimal string without BitString unused bits
<span class='line'>362</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>363</span>      * @description
<span class='line'>364</span>      * This method will get signature value of certificate:
<span class='line'>365</span>      * @example
<span class='line'>366</span>      * var x = new X509();
<span class='line'>367</span>      * x.readCertPEM(sCertPEM);
<span class='line'>368</span>      * x.getSignatureValueHex() &rarr "8a4c47913..."
<span class='line'>369</span>      */</span><span class="WHIT">
<span class='line'>370</span> </span><span class="WHIT">    </span><span class="NAME">this.getSignatureValueHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>371</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">2</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"03"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>372</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>373</span> 
<span class='line'>374</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>375</span>      * verifies signature value by public key&lt;br/>
<span class='line'>376</span>      * @name verifySignature
<span class='line'>377</span>      * @memberOf X509#
<span class='line'>378</span>      * @function
<span class='line'>379</span>      * @param {Object} pubKey public key object
<span class='line'>380</span>      * @return {Boolean} true if signature value is valid otherwise false
<span class='line'>381</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>382</span>      * @description
<span class='line'>383</span>      * This method verifies signature value of hexadecimal string of 
<span class='line'>384</span>      * X.509 certificate by specified public key object.
<span class='line'>385</span>      * @example
<span class='line'>386</span>      * pubKey = KEYUTIL.getKey(pemPublicKey); // or certificate
<span class='line'>387</span>      * x = new X509();
<span class='line'>388</span>      * x.readCertPEM(pemCert);
<span class='line'>389</span>      * x.verifySignature(pubKey) &rarr; true, false or raising exception
<span class='line'>390</span>      */</span><span class="WHIT">
<span class='line'>391</span> </span><span class="WHIT">    </span><span class="NAME">this.verifySignature</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">pubKey</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>392</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">algName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getSignatureAlgorithmName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>393</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hSigVal</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getSignatureValueHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>394</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hTbsCert</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>395</span> </span><span class="WHIT">	
<span class='line'>396</span> 	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">sig</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">KJUR.crypto.Signature</span><span class="PUNC">(</span><span class="PUNC">{</span><span class="NAME">alg</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">algName</span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>397</span> </span><span class="WHIT">	</span><span class="NAME">sig.init</span><span class="PUNC">(</span><span class="NAME">pubKey</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>398</span> </span><span class="WHIT">	</span><span class="NAME">sig.updateHex</span><span class="PUNC">(</span><span class="NAME">hTbsCert</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>399</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">sig.verify</span><span class="PUNC">(</span><span class="NAME">hSigVal</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>400</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>401</span> 
<span class='line'>402</span> </span><span class="WHIT">    </span><span class="COMM">// ===== parse extension ======================================</span><span class="WHIT">
<span class='line'>403</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>404</span>      * set array of X.509v3 extesion information such as extension OID, criticality and value index.&lt;br/>
<span class='line'>405</span>      * @name parseExt
<span class='line'>406</span>      * @memberOf X509#
<span class='line'>407</span>      * @function
<span class='line'>408</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>409</span>      * @description
<span class='line'>410</span>      * This method will set an array of X.509v3 extension information having 
<span class='line'>411</span>      * following parameters:
<span class='line'>412</span>      * &lt;ul>
<span class='line'>413</span>      * &lt;li>oid - extension OID (ex. 2.5.29.19)&lt;/li>
<span class='line'>414</span>      * &lt;li>critical - true or false&lt;/li>
<span class='line'>415</span>      * &lt;li>vidx - string index for extension value&lt;/li>
<span class='line'>416</span>      * @example
<span class='line'>417</span>      * x = new X509();
<span class='line'>418</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>419</span>      *
<span class='line'>420</span>      * x.aExtInfo &rarr;
<span class='line'>421</span>      * [ { oid: "2.5.29,19", critical: true, vidx: 2504 }, ... ]
<span class='line'>422</span>      */</span><span class="WHIT">
<span class='line'>423</span> </span><span class="WHIT">    </span><span class="NAME">this.parseExt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>424</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">this.version</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>425</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">iExtSeq</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getIdxbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>426</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aExtIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">iExtSeq</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>427</span> 
<span class='line'>428</span> </span><span class="WHIT">	</span><span class="NAME">this.aExtInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>429</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aExtIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>430</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">item</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>431</span> </span><span class="WHIT">	    </span><span class="NAME">item.critical</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">false</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>432</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aExtIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>433</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">offset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>434</span> 
<span class='line'>435</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">3</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>436</span> </span><span class="WHIT">		</span><span class="NAME">item.critical</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>437</span> </span><span class="WHIT">		</span><span class="NAME">offset</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>438</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>439</span> 
<span class='line'>440</span> </span><span class="WHIT">	    </span><span class="NAME">item.oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.hextooidstr</span><span class="PUNC">(</span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aExtIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>441</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">octidx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getIdxbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aExtIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">offset</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>442</span> </span><span class="WHIT">	    </span><span class="NAME">item.vidx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVidx</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">octidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>443</span> </span><span class="WHIT">	    </span><span class="NAME">this.aExtInfo.push</span><span class="PUNC">(</span><span class="NAME">item</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>444</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>445</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>446</span> 
<span class='line'>447</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>448</span>      * get a X.509v3 extesion information such as extension OID, criticality and value index for specified oid or name.&lt;br/>
<span class='line'>449</span>      * @name getExtInfo
<span class='line'>450</span>      * @memberOf X509#
<span class='line'>451</span>      * @function
<span class='line'>452</span>      * @param {String} oidOrName X.509 extension oid or name (ex. keyUsage or 2.5.29.19)
<span class='line'>453</span>      * @return X.509 extension information such as extension OID or value indx (see {@link X509#parseExt})
<span class='line'>454</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>455</span>      * @description
<span class='line'>456</span>      * This method will get an X.509v3 extension information JSON object
<span class='line'>457</span>      * having extension OID, criticality and value idx for specified
<span class='line'>458</span>      * extension OID or name.
<span class='line'>459</span>      * If there is no such extension, this returns undefined.
<span class='line'>460</span>      * @example
<span class='line'>461</span>      * x = new X509();
<span class='line'>462</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>463</span>      *
<span class='line'>464</span>      * x.getExtInfo("keyUsage") &rarr; { oid: "2.5.29.15", critical: true, vidx: 1714 }
<span class='line'>465</span>      * x.getExtInfo("unknownExt") &rarr; undefined
<span class='line'>466</span>      */</span><span class="WHIT">
<span class='line'>467</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">oidOrName</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>468</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.aExtInfo</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>469</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">oidOrName</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>470</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">!</span><span class="WHIT"> </span><span class="NAME">oidOrName.match</span><span class="PUNC">(</span><span class="REGX">/^[0-9.]+$/</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>471</span> </span><span class="WHIT">	    </span><span class="NAME">oid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.name2oid</span><span class="PUNC">(</span><span class="NAME">oidOrName</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>472</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>473</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">oid</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>474</span> 
<span class='line'>475</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>476</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">oid</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">oid</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>477</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>478</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>479</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>480</span> 
<span class='line'>481</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>482</span>      * get BasicConstraints extension value as object in the certificate
<span class='line'>483</span>      * @name getExtBasicConstraints
<span class='line'>484</span>      * @memberOf X509#
<span class='line'>485</span>      * @function
<span class='line'>486</span>      * @return {Object} associative array which may have "cA" and "pathLen" parameters
<span class='line'>487</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>488</span>      * @description
<span class='line'>489</span>      * This method will get basic constraints extension value as object with following paramters.
<span class='line'>490</span>      * &lt;ul>
<span class='line'>491</span>      * &lt;li>cA - CA flag whether CA or not&lt;/li>
<span class='line'>492</span>      * &lt;li>pathLen - maximum intermediate certificate length&lt;/li>
<span class='line'>493</span>      * &lt;/ul>
<span class='line'>494</span>      * There are use cases for return values:
<span class='line'>495</span>      * &lt;ul>
<span class='line'>496</span>      * &lt;li>{cA:true, pathLen:3} - cA flag is true and pathLen is 3&lt;/li>
<span class='line'>497</span>      * &lt;li>{cA:true} - cA flag is true and no pathLen&lt;/li>
<span class='line'>498</span>      * &lt;li>{} - basic constraints has no value in case of end entity certificate&lt;/li>
<span class='line'>499</span>      * &lt;li>undefined - there is no basic constraints extension&lt;/li>
<span class='line'>500</span>      * &lt;/ul>
<span class='line'>501</span>      * @example
<span class='line'>502</span>      * x = new X509();
<span class='line'>503</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>504</span>      * x.getExtBasicConstraints() &rarr; { cA: true, pathLen: 3 };
<span class='line'>505</span>      */</span><span class="WHIT">
<span class='line'>506</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtBasicConstraints</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>507</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"basicConstraints"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>508</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>509</span> 
<span class='line'>510</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hBC</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>511</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hBC</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>512</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hBC</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'0101ff'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">cA</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>513</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hBC.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">8</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">'0101ff02'</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>514</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pathLexHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hBC</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">6</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>515</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">pathLen</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">pathLexHex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>516</span> </span><span class="WHIT">	    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">cA</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pathLen</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="NAME">pathLen</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>517</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>518</span> </span><span class="WHIT">	</span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"basicConstraints parse error"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>519</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>520</span> 
<span class='line'>521</span> 
<span class='line'>522</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>523</span>      * get KeyUsage extension value as binary string in the certificate&lt;br/>
<span class='line'>524</span>      * @name getExtKeyUsageBin
<span class='line'>525</span>      * @memberOf X509#
<span class='line'>526</span>      * @function
<span class='line'>527</span>      * @return {String} binary string of key usage bits (ex. '101')
<span class='line'>528</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>529</span>      * @description
<span class='line'>530</span>      * This method will get key usage extension value
<span class='line'>531</span>      * as binary string such like '101'.
<span class='line'>532</span>      * Key usage bits definition is in the RFC 5280.
<span class='line'>533</span>      * If there is no key usage extension in the certificate,
<span class='line'>534</span>      * it returns empty string (i.e. '').
<span class='line'>535</span>      * @example
<span class='line'>536</span>      * x = new X509();
<span class='line'>537</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>538</span>      * x.getExtKeyUsageBin() &rarr; '101'
<span class='line'>539</span>      * // 1 - digitalSignature
<span class='line'>540</span>      * // 0 - nonRepudiation
<span class='line'>541</span>      * // 1 - keyEncipherment
<span class='line'>542</span>      */</span><span class="WHIT">
<span class='line'>543</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtKeyUsageBin</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>544</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"keyUsage"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>545</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>546</span> </span><span class="WHIT">	
<span class='line'>547</span> 	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hKeyUsage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>548</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hKeyUsage.length</span><span class="WHIT"> </span><span class="PUNC">%</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">!=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">hKeyUsage.length</span><span class="WHIT"> </span><span class="PUNC">&lt;=</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>549</span> </span><span class="WHIT">	    </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"malformed key usage value"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>550</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">unusedBits</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">hKeyUsage.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>551</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bKeyUsage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">parseInt</span><span class="PUNC">(</span><span class="NAME">hKeyUsage.substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">toString</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>552</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">bKeyUsage.substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">bKeyUsage.length</span><span class="WHIT"> </span><span class="PUNC">-</span><span class="WHIT"> </span><span class="NAME">unusedBits</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>553</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>554</span> 
<span class='line'>555</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>556</span>      * get KeyUsage extension value as names in the certificate&lt;br/>
<span class='line'>557</span>      * @name getExtKeyUsageString
<span class='line'>558</span>      * @memberOf X509#
<span class='line'>559</span>      * @function
<span class='line'>560</span>      * @return {String} comma separated string of key usage
<span class='line'>561</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>562</span>      * @description
<span class='line'>563</span>      * This method will get key usage extension value
<span class='line'>564</span>      * as comma separated string of usage names.
<span class='line'>565</span>      * If there is no key usage extension in the certificate,
<span class='line'>566</span>      * it returns empty string (i.e. '').
<span class='line'>567</span>      * @example
<span class='line'>568</span>      * x = new X509();
<span class='line'>569</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>570</span>      * x.getExtKeyUsageString() &rarr; "digitalSignature,keyEncipherment"
<span class='line'>571</span>      */</span><span class="WHIT">
<span class='line'>572</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtKeyUsageString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>573</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bKeyUsage</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtKeyUsageBin</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>574</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>575</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">bKeyUsage.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>576</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">bKeyUsage.substr</span><span class="PUNC">(</span><span class="NAME">i</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">==</span><span class="WHIT"> </span><span class="STRN">"1"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="NAME">X509.KEYUSAGE_NAME</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>577</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>578</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.join</span><span class="PUNC">(</span><span class="STRN">","</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>579</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>580</span> 
<span class='line'>581</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>582</span>      * get subjectKeyIdentifier value as hexadecimal string in the certificate&lt;br/>
<span class='line'>583</span>      * @name getExtSubjectKeyIdentifier
<span class='line'>584</span>      * @memberOf X509#
<span class='line'>585</span>      * @function
<span class='line'>586</span>      * @return {String} hexadecimal string of subject key identifier or null
<span class='line'>587</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>588</span>      * @description
<span class='line'>589</span>      * This method will get subject key identifier extension value
<span class='line'>590</span>      * as hexadecimal string.
<span class='line'>591</span>      * If there is this in the certificate, it returns undefined;
<span class='line'>592</span>      * @example
<span class='line'>593</span>      * x = new X509();
<span class='line'>594</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>595</span>      * x.getExtSubjectKeyIdentifier() &rarr; "1b3347ab...";
<span class='line'>596</span>      */</span><span class="WHIT">
<span class='line'>597</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtSubjectKeyIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>598</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"subjectKeyIdentifier"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>599</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>600</span> 
<span class='line'>601</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>602</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>603</span> 
<span class='line'>604</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>605</span>      * get authorityKeyIdentifier value as JSON object in the certificate&lt;br/>
<span class='line'>606</span>      * @name getExtAuthorityKeyIdentifier
<span class='line'>607</span>      * @memberOf X509#
<span class='line'>608</span>      * @function
<span class='line'>609</span>      * @return {Object} JSON object of authority key identifier or null
<span class='line'>610</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>611</span>      * @description
<span class='line'>612</span>      * This method will get authority key identifier extension value
<span class='line'>613</span>      * as JSON object.
<span class='line'>614</span>      * If there is this in the certificate, it returns undefined;
<span class='line'>615</span>      * &lt;br>
<span class='line'>616</span>      * NOTE: Currently this method only supports keyIdentifier so that
<span class='line'>617</span>      * authorityCertIssuer and authorityCertSerialNumber will not
<span class='line'>618</span>      * be return in the JSON object.
<span class='line'>619</span>      * @example
<span class='line'>620</span>      * x = new X509();
<span class='line'>621</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>622</span>      * x.getExtAuthorityKeyIdentifier() &rarr; { kid: "1234abcd..." }
<span class='line'>623</span>      */</span><span class="WHIT">
<span class='line'>624</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtAuthorityKeyIdentifier</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>625</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"authorityKeyIdentifier"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>626</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>627</span> 
<span class='line'>628</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>629</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hAKID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>630</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hAKID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>631</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>632</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hAKID.substr</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"80"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>633</span> </span><span class="WHIT">		</span><span class="NAME">result.kid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hAKID</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>634</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>635</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>636</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>637</span> 
<span class='line'>638</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>639</span>      * get extKeyUsage value as array of name string in the certificate&lt;br/>
<span class='line'>640</span>      * @name getExtExtKeyUsageName
<span class='line'>641</span>      * @memberOf X509#
<span class='line'>642</span>      * @function
<span class='line'>643</span>      * @return {Object} array of extended key usage ID name or oid
<span class='line'>644</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>645</span>      * @description
<span class='line'>646</span>      * This method will get extended key usage extension value
<span class='line'>647</span>      * as array of name or OID string.
<span class='line'>648</span>      * If there is this in the certificate, it returns undefined;
<span class='line'>649</span>      * &lt;br>
<span class='line'>650</span>      * NOTE: Supported extended key usage ID names are defined in
<span class='line'>651</span>      * name2oidList parameter in asn1x509.js file.
<span class='line'>652</span>      * @example
<span class='line'>653</span>      * x = new X509();
<span class='line'>654</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>655</span>      * x.getExtExtKeyUsageName() &rarr; ["serverAuth", "clientAuth", "0.1.2.3.4.5"]
<span class='line'>656</span>      */</span><span class="WHIT">
<span class='line'>657</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtExtKeyUsageName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>658</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"extKeyUsage"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>659</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>660</span> 
<span class='line'>661</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>662</span> </span><span class="WHIT">	
<span class='line'>663</span> 	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>664</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>665</span> 
<span class='line'>666</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>667</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>668</span> </span><span class="WHIT">	    </span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="NAME">_oidname</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>669</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>670</span> 
<span class='line'>671</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>672</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>673</span> 
<span class='line'>674</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>675</span>      * (DEPRECATED) get subjectAltName value as array of string in the certificate
<span class='line'>676</span>      * @name getExtSubjectAltName
<span class='line'>677</span>      * @memberOf X509#
<span class='line'>678</span>      * @function
<span class='line'>679</span>      * @return {Object} array of alt names
<span class='line'>680</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>681</span>      * @deprecated since jsrsasign 8.0.1 x509 1.1.17. Please move to {@link X509#getExtSubjectAltName2}
<span class='line'>682</span>      * @description
<span class='line'>683</span>      * This method will get subject alt name extension value
<span class='line'>684</span>      * as array of name.
<span class='line'>685</span>      * If there is this in the certificate, it returns undefined;
<span class='line'>686</span>      * &lt;br>
<span class='line'>687</span>      * NOTE: Currently this method supports only dNSName so that
<span class='line'>688</span>      * other name type such like iPAddress or generalName will not be returned.
<span class='line'>689</span>      * @example
<span class='line'>690</span>      * x = new X509();
<span class='line'>691</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>692</span>      * x.getExtSubjectAltName() &rarr; ["example.com", "example.org"]
<span class='line'>693</span>      */</span><span class="WHIT">
<span class='line'>694</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtSubjectAltName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>695</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtSubjectAltName2</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>696</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>697</span> 
<span class='line'>698</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>699</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"DNS"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>700</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>701</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>702</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>703</span> 
<span class='line'>704</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>705</span>      * get subjectAltName value as array of string in the certificate
<span class='line'>706</span>      * @name getExtSubjectAltName2
<span class='line'>707</span>      * @memberOf X509#
<span class='line'>708</span>      * @function
<span class='line'>709</span>      * @return {Object} array of alt name array
<span class='line'>710</span>      * @since jsrsasign 8.0.1 x509 1.1.17
<span class='line'>711</span>      * @description
<span class='line'>712</span>      * This method will get subject alt name extension value
<span class='line'>713</span>      * as array of type and name.
<span class='line'>714</span>      * If there is this in the certificate, it returns undefined;
<span class='line'>715</span>      * Type of GeneralName will be shown as following:
<span class='line'>716</span>      * &lt;ul>
<span class='line'>717</span>      * &lt;li>"MAIL" - [1]rfc822Name&lt;/li>
<span class='line'>718</span>      * &lt;li>"DNS"  - [2]dNSName&lt;/li>
<span class='line'>719</span>      * &lt;li>"DN"   - [4]directoryName&lt;/li>
<span class='line'>720</span>      * &lt;li>"URI"  - [6]uniformResourceIdentifier&lt;/li>
<span class='line'>721</span>      * &lt;li>"IP"   - [7]iPAddress&lt;/li>
<span class='line'>722</span>      * &lt;/ul>
<span class='line'>723</span>      * @example
<span class='line'>724</span>      * x = new X509();
<span class='line'>725</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>726</span>      * x.getExtSubjectAltName2() &rarr;
<span class='line'>727</span>      * [["DNS",  "example.com"],
<span class='line'>728</span>      *  ["DNS",  "example.org"],
<span class='line'>729</span>      *  ["MAIL", "foo@example.com"],
<span class='line'>730</span>      *  ["IP",   "192.168.1.1"],
<span class='line'>731</span>      *  ["IP",   "2001:db8::2:1"],
<span class='line'>732</span>      *  ["DN",   "/C=US/O=TEST1"]]
<span class='line'>733</span>      */</span><span class="WHIT">
<span class='line'>734</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtSubjectAltName2</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>735</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">gnValueHex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">gnValueStr</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">gnTag</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>736</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"subjectAltName"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>737</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>738</span> 
<span class='line'>739</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>740</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">h</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>741</span> 
<span class='line'>742</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>743</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>744</span> </span><span class="WHIT">	    </span><span class="NAME">gnTag</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">h.substr</span><span class="PUNC">(</span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>745</span> </span><span class="WHIT">	    </span><span class="NAME">gnValueHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>746</span> </span><span class="WHIT">	    
<span class='line'>747</span> 	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">gnTag</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"81"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// rfc822Name [1]</span><span class="WHIT">
<span class='line'>748</span> </span><span class="WHIT">		</span><span class="NAME">gnValueStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">gnValueHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>749</span> </span><span class="WHIT">		</span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="STRN">"MAIL"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">gnValueStr</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>750</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>751</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">gnTag</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"82"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// dNSName [2]</span><span class="WHIT">
<span class='line'>752</span> </span><span class="WHIT">		</span><span class="NAME">gnValueStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">gnValueHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>753</span> </span><span class="WHIT">		</span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="STRN">"DNS"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">gnValueStr</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>754</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>755</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">gnTag</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"84"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// directoryName [4]</span><span class="WHIT">
<span class='line'>756</span> </span><span class="WHIT">		</span><span class="NAME">gnValueStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X509.hex2dn</span><span class="PUNC">(</span><span class="NAME">gnValueHex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>757</span> </span><span class="WHIT">		</span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="STRN">"DN"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">gnValueStr</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>758</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>759</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">gnTag</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"86"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// uniformResourceIdentifier [6]</span><span class="WHIT">
<span class='line'>760</span> </span><span class="WHIT">		</span><span class="NAME">gnValueStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">gnValueHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>761</span> </span><span class="WHIT">		</span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="STRN">"URI"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">gnValueStr</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>762</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>763</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">gnTag</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"87"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// iPAddress [7]</span><span class="WHIT">
<span class='line'>764</span> </span><span class="WHIT">		</span><span class="NAME">gnValueStr</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoip</span><span class="PUNC">(</span><span class="NAME">gnValueHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>765</span> </span><span class="WHIT">		</span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="PUNC">[</span><span class="STRN">"IP"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">gnValueStr</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>766</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>767</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>768</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>769</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>770</span> 
<span class='line'>771</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>772</span>      * get array of string for fullName URIs in cRLDistributionPoints(CDP) in the certificate
<span class='line'>773</span>      * @name getExtCRLDistributionPointsURI
<span class='line'>774</span>      * @memberOf X509#
<span class='line'>775</span>      * @function
<span class='line'>776</span>      * @return {Object} array of fullName URIs of CDP of the certificate
<span class='line'>777</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>778</span>      * @description
<span class='line'>779</span>      * This method will get all fullName URIs of cRLDistributionPoints extension
<span class='line'>780</span>      * in the certificate as array of URI string.
<span class='line'>781</span>      * If there is this in the certificate, it returns undefined;
<span class='line'>782</span>      * &lt;br>
<span class='line'>783</span>      * NOTE: Currently this method supports only fullName URI so that
<span class='line'>784</span>      * other parameters will not be returned.
<span class='line'>785</span>      * @example
<span class='line'>786</span>      * x = new X509();
<span class='line'>787</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>788</span>      * x.getExtCRLDistributionPointsURI() &rarr;
<span class='line'>789</span>      * ["http://example.com/aaa.crl", "http://example.org/aaa.crl"]
<span class='line'>790</span>      */</span><span class="WHIT">
<span class='line'>791</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtCRLDistributionPointsURI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>792</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"cRLDistributionPoints"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>793</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>794</span> 
<span class='line'>795</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>796</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>797</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>798</span> </span><span class="WHIT">	    </span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>799</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hURI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"86"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>800</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">uri</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">hURI</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>801</span> </span><span class="WHIT">		</span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="NAME">uri</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>802</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>803</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>804</span> 
<span class='line'>805</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>806</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>807</span> 
<span class='line'>808</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>809</span>      * get AuthorityInfoAccess extension value in the certificate as associative array
<span class='line'>810</span>      * @name getExtAIAInfo
<span class='line'>811</span>      * @memberOf X509#
<span class='line'>812</span>      * @function
<span class='line'>813</span>      * @return {Object} associative array of AIA extension properties
<span class='line'>814</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>815</span>      * @description
<span class='line'>816</span>      * This method will get authority info access value
<span class='line'>817</span>      * as associate array which has following properties:
<span class='line'>818</span>      * &lt;ul>
<span class='line'>819</span>      * &lt;li>ocsp - array of string for OCSP responder URL&lt;/li>
<span class='line'>820</span>      * &lt;li>caissuer - array of string for caIssuer value (i.e. CA certificates URL)&lt;/li>
<span class='line'>821</span>      * &lt;/ul>
<span class='line'>822</span>      * If there is this in the certificate, it returns undefined;
<span class='line'>823</span>      * @example
<span class='line'>824</span>      * x = new X509();
<span class='line'>825</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>826</span>      * x.getExtAIAInfo(hCert) &rarr; 
<span class='line'>827</span>      * { ocsp:     ["http://ocsp.foo.com"],
<span class='line'>828</span>      *   caissuer: ["http://rep.foo.com/aaa.p8m"] }
<span class='line'>829</span>      */</span><span class="WHIT">
<span class='line'>830</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtAIAInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>831</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"authorityInfoAccess"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>832</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>833</span> 
<span class='line'>834</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="NAME">ocsp</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">caissuer</span><span class="PUNC">:</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>835</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>836</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>837</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hOID</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>838</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"86"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>839</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hOID</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"2b06010505073001"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>840</span> </span><span class="WHIT">		</span><span class="NAME">result.ocsp.push</span><span class="PUNC">(</span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">hName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>841</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>842</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hOID</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"2b06010505073002"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>843</span> </span><span class="WHIT">		</span><span class="NAME">result.caissuer.push</span><span class="PUNC">(</span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">hName</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>844</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>845</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>846</span> 
<span class='line'>847</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>848</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>849</span> 
<span class='line'>850</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>851</span>      * get CertificatePolicies extension value in the certificate as array
<span class='line'>852</span>      * @name getExtCertificatePolicies
<span class='line'>853</span>      * @memberOf X509#
<span class='line'>854</span>      * @function
<span class='line'>855</span>      * @return {Object} array of PolicyInformation JSON object
<span class='line'>856</span>      * @since jsrsasign 7.2.0 x509 1.1.14
<span class='line'>857</span>      * @description
<span class='line'>858</span>      * This method will get certificate policies value
<span class='line'>859</span>      * as an array of JSON object which has following properties:
<span class='line'>860</span>      * &lt;ul>
<span class='line'>861</span>      * &lt;li>id - &lt;/li>
<span class='line'>862</span>      * &lt;li>cps - URI of certification practice statement&lt;/li>
<span class='line'>863</span>      * &lt;li>unotice - string of UserNotice explicitText&lt;/li>
<span class='line'>864</span>      * &lt;/ul>
<span class='line'>865</span>      * If there is this extension in the certificate,
<span class='line'>866</span>      * it returns undefined;
<span class='line'>867</span>      * @example
<span class='line'>868</span>      * x = new X509();
<span class='line'>869</span>      * x.readCertPEM(sCertPEM); // parseExt() will also be called internally.
<span class='line'>870</span>      * x.getExtCertificatePolicies &rarr; 
<span class='line'>871</span>      * [{ id: 1.2.3.4,
<span class='line'>872</span>      *    cps: "http://example.com/cps",
<span class='line'>873</span>      *    unotice: "explicit text" }]
<span class='line'>874</span>      */</span><span class="WHIT">
<span class='line'>875</span> </span><span class="WHIT">    </span><span class="NAME">this.getExtCertificatePolicies</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>876</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtInfo</span><span class="PUNC">(</span><span class="STRN">"certificatePolicies"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>877</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>878</span> </span><span class="WHIT">	
<span class='line'>879</span> 	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hExt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getTLV</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">info.vidx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>880</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>881</span> 
<span class='line'>882</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hExt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>883</span> </span><span class="WHIT">	</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>884</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">policyInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>885</span> </span><span class="WHIT">	    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a1</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hExt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>886</span> 
<span class='line'>887</span> </span><span class="WHIT">	    </span><span class="NAME">policyInfo.id</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_oidname</span><span class="PUNC">(</span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hExt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a1</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>888</span> 
<span class='line'>889</span> </span><span class="WHIT">	    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">a1.length</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>890</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a2</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getChildIdx</span><span class="PUNC">(</span><span class="NAME">hExt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a1</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>891</span> 
<span class='line'>892</span> </span><span class="WHIT">		</span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">a2.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>893</span> </span><span class="WHIT">		    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hQualifierId</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">hExt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a2</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>894</span> 
<span class='line'>895</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hQualifierId</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"2b06010505070201"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// cps</span><span class="WHIT">
<span class='line'>896</span> </span><span class="WHIT">			</span><span class="NAME">policyInfo.cps</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">hExt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a2</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>897</span> </span><span class="WHIT">		    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hQualifierId</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"2b06010505070202"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// unotice</span><span class="WHIT">
<span class='line'>898</span> </span><span class="WHIT">			</span><span class="NAME">policyInfo.unotice</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT">
<span class='line'>899</span> </span><span class="WHIT">			    </span><span class="NAME">hextoutf8</span><span class="PUNC">(</span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">hExt</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">a2</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>900</span> </span><span class="WHIT">		    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>901</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>902</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>903</span> 
<span class='line'>904</span> </span><span class="WHIT">	    </span><span class="NAME">result.push</span><span class="PUNC">(</span><span class="NAME">policyInfo</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>905</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>906</span> 
<span class='line'>907</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>908</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>909</span> 
<span class='line'>910</span> </span><span class="WHIT">    </span><span class="COMM">// ===== read certificate =====================================</span><span class="WHIT">
<span class='line'>911</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>912</span>      * read PEM formatted X.509 certificate from string.&lt;br/>
<span class='line'>913</span>      * @name readCertPEM
<span class='line'>914</span>      * @memberOf X509#
<span class='line'>915</span>      * @function
<span class='line'>916</span>      * @param {String} sCertPEM string for PEM formatted X.509 certificate
<span class='line'>917</span>      * @example
<span class='line'>918</span>      * x = new X509();
<span class='line'>919</span>      * x.readCertPEM(sCertPEM); // read certificate
<span class='line'>920</span>      */</span><span class="WHIT">
<span class='line'>921</span> </span><span class="WHIT">    </span><span class="NAME">this.readCertPEM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sCertPEM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>922</span> </span><span class="WHIT">        </span><span class="NAME">this.readCertHex</span><span class="PUNC">(</span><span class="NAME">_pemtohex</span><span class="PUNC">(</span><span class="NAME">sCertPEM</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>923</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>924</span> 
<span class='line'>925</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>926</span>      * read a hexadecimal string of X.509 certificate&lt;br/>
<span class='line'>927</span>      * @name readCertHex
<span class='line'>928</span>      * @memberOf X509#
<span class='line'>929</span>      * @function
<span class='line'>930</span>      * @param {String} sCertHex hexadecimal string of X.509 certificate
<span class='line'>931</span>      * @since jsrsasign 7.1.4 x509 1.1.13
<span class='line'>932</span>      * @description
<span class='line'>933</span>      * NOTE: {@link X509#parseExt} will called internally since jsrsasign 7.2.0.
<span class='line'>934</span>      * @example
<span class='line'>935</span>      * x = new X509();
<span class='line'>936</span>      * x.readCertHex("3082..."); // read certificate
<span class='line'>937</span>      */</span><span class="WHIT">
<span class='line'>938</span> </span><span class="WHIT">    </span><span class="NAME">this.readCertHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sCertHex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>939</span> </span><span class="WHIT">        </span><span class="NAME">this.hex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">sCertHex</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>940</span> </span><span class="WHIT">	</span><span class="NAME">this.getVersion</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// set version parameter</span><span class="WHIT">
<span class='line'>941</span> 
<span class='line'>942</span> </span><span class="WHIT">	</span><span class="KEYW">try</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>943</span> </span><span class="WHIT">	    </span><span class="NAME">_getIdxbyList</span><span class="PUNC">(</span><span class="NAME">this.hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">7</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"a3"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="COMM">// has [3] v3ext</span><span class="WHIT">
<span class='line'>944</span> </span><span class="WHIT">	    </span><span class="NAME">this.parseExt</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>945</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">catch</span><span class="PUNC">(</span><span class="NAME">ex</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>946</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>947</span> 
<span class='line'>948</span> </span><span class="WHIT">    </span><span class="COMM">/**
<span class='line'>949</span>      * get certificate information as string.&lt;br/>
<span class='line'>950</span>      * @name getInfo
<span class='line'>951</span>      * @memberOf X509#
<span class='line'>952</span>      * @function
<span class='line'>953</span>      * @return {String} certificate information string
<span class='line'>954</span>      * @since jsrsasign 5.0.10 x509 1.1.8
<span class='line'>955</span>      * @example
<span class='line'>956</span>      * x = new X509();
<span class='line'>957</span>      * x.readCertPEM(certPEM);
<span class='line'>958</span>      * console.log(x.getInfo());
<span class='line'>959</span>      * // this shows as following
<span class='line'>960</span>      * Basic Fields
<span class='line'>961</span>      *   serial number: 02ac5c266a0b409b8f0b79f2ae462577
<span class='line'>962</span>      *   signature algorithm: SHA1withRSA
<span class='line'>963</span>      *   issuer: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
<span class='line'>964</span>      *   notBefore: 061110000000Z
<span class='line'>965</span>      *   notAfter: 311110000000Z
<span class='line'>966</span>      *   subject: /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert High Assurance EV Root CA
<span class='line'>967</span>      *   subject public key info:
<span class='line'>968</span>      *     key algorithm: RSA
<span class='line'>969</span>      *     n=c6cce573e6fbd4bb...
<span class='line'>970</span>      *     e=10001
<span class='line'>971</span>      * X509v3 Extensions:
<span class='line'>972</span>      *   keyUsage CRITICAL:
<span class='line'>973</span>      *     digitalSignature,keyCertSign,cRLSign
<span class='line'>974</span>      *   basicConstraints CRITICAL:
<span class='line'>975</span>      *     cA=true
<span class='line'>976</span>      *   subjectKeyIdentifier :
<span class='line'>977</span>      *     b13ec36903f8bf4701d498261a0802ef63642bc3
<span class='line'>978</span>      *   authorityKeyIdentifier :
<span class='line'>979</span>      *     kid=b13ec36903f8bf4701d498261a0802ef63642bc3
<span class='line'>980</span>      * signature algorithm: SHA1withRSA
<span class='line'>981</span>      * signature: 1c1a0697dcd79c9f...
<span class='line'>982</span>      */</span><span class="WHIT">
<span class='line'>983</span> </span><span class="WHIT">    </span><span class="NAME">this.getInfo</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>984</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_X509</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>985</span> </span><span class="WHIT">	</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pubkey</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aExt</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>986</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT">  </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"Basic Fields\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>987</span> </span><span class="WHIT">        </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"  serial number: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getSerialNumberHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>988</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"  signature algorithm: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getSignatureAlgorithmField</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>989</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"  issuer: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getIssuerString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>990</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"  notBefore: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getNotBefore</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>991</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"  notAfter: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getNotAfter</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>992</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"  subject: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getSubjectString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>993</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"  subject public key info: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>994</span> 
<span class='line'>995</span> </span><span class="WHIT">	</span><span class="COMM">// subject public key info</span><span class="WHIT">
<span class='line'>996</span> </span><span class="WHIT">	</span><span class="NAME">pubkey</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getPublicKey</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>997</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    key algorithm: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">pubkey.type</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>998</span> 
<span class='line'>999</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">pubkey.type</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"RSA"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1000</span> </span><span class="WHIT">	    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    n="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoposhex</span><span class="PUNC">(</span><span class="NAME">pubkey.n.toString</span><span class="PUNC">(</span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"...\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1001</span> </span><span class="WHIT">	    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    e="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">hextoposhex</span><span class="PUNC">(</span><span class="NAME">pubkey.e.toString</span><span class="PUNC">(</span><span class="NUMB">16</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1002</span> </span><span class="WHIT">	</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1003</span> 
<span class='line'>1004</span> </span><span class="WHIT">	</span><span class="COMM">// X.509v3 Extensions</span><span class="WHIT">
<span class='line'>1005</span> </span><span class="WHIT">        </span><span class="NAME">aExt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.aExtInfo</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1006</span> 
<span class='line'>1007</span> </span><span class="WHIT">	</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aExt</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="WHIT"> </span><span class="PUNC">&&</span><span class="WHIT"> </span><span class="NAME">aExt</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1008</span> </span><span class="WHIT">            </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"X509v3 Extensions:\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1009</span> </span><span class="WHIT">	    
<span class='line'>1010</span>             </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aExt.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1011</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">info</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">aExt</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1012</span> 
<span class='line'>1013</span> </span><span class="WHIT">		</span><span class="COMM">// show extension name and critical flag</span><span class="WHIT">
<span class='line'>1014</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.oid2name</span><span class="PUNC">(</span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">"oid"</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1015</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">"oid"</span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1016</span> 
<span class='line'>1017</span> </span><span class="WHIT">		</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">critical</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">''</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1018</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">info</span><span class="PUNC">[</span><span class="STRN">"critical"</span><span class="PUNC">]</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="KEYW">true</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">critical</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"CRITICAL"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1019</span> 
<span class='line'>1020</span> </span><span class="WHIT">		</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"  "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">" "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">critical</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">":\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1021</span> 
<span class='line'>1022</span> </span><span class="WHIT">		</span><span class="COMM">// show extension value if supported</span><span class="WHIT">
<span class='line'>1023</span> </span><span class="WHIT">		</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"basicConstraints"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1024</span> </span><span class="WHIT">		    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">bc</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtBasicConstraints</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1025</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">bc.cA</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1026</span> </span><span class="WHIT">			</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    {}\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1027</span> </span><span class="WHIT">		    </span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1028</span> </span><span class="WHIT">			</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    cA=true"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1029</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">bc.pathLen</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1030</span> </span><span class="WHIT">			    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">", pathLen="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">bc.pathLen</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1031</span> </span><span class="WHIT">			</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1032</span> </span><span class="WHIT">		    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1033</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"keyUsage"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1034</span> </span><span class="WHIT">		    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getExtKeyUsageString</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1035</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"subjectKeyIdentifier"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1036</span> </span><span class="WHIT">		    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getExtSubjectKeyIdentifier</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1037</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"authorityKeyIdentifier"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1038</span> </span><span class="WHIT">		    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">akid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtAuthorityKeyIdentifier</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1039</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">akid.kid</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1040</span> </span><span class="WHIT">			</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    kid="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">akid.kid</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1041</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"extKeyUsage"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1042</span> </span><span class="WHIT">		    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">eku</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtExtKeyUsageName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1043</span> </span><span class="WHIT">		    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">eku.join</span><span class="PUNC">(</span><span class="STRN">", "</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1044</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"subjectAltName"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1045</span> </span><span class="WHIT">		    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">san</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtSubjectAltName2</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1046</span> </span><span class="WHIT">		    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">san</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1047</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"cRLDistributionPoints"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1048</span> </span><span class="WHIT">		    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">cdp</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtCRLDistributionPointsURI</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1049</span> </span><span class="WHIT">		    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">cdp</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1050</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"authorityInfoAccess"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1051</span> </span><span class="WHIT">		    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aia</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtAIAInfo</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1052</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aia.ocsp</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1053</span> </span><span class="WHIT">			</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    ocsp: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">aia.ocsp.join</span><span class="PUNC">(</span><span class="STRN">","</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1054</span> </span><span class="WHIT">		    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aia.caissuer</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1055</span> </span><span class="WHIT">			</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    caissuer: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">aia.caissuer.join</span><span class="PUNC">(</span><span class="STRN">","</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1056</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT"> </span><span class="KEYW">else</span><span class="WHIT"> </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">extName</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"certificatePolicies"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1057</span> </span><span class="WHIT">		    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aCP</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">this.getExtCertificatePolicies</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1058</span> </span><span class="WHIT">		    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aCP.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">j</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1059</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aCP</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1060</span> </span><span class="WHIT">			    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    policy oid: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">aCP</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">id</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1061</span> </span><span class="WHIT">			</span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aCP</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">cps</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1062</span> </span><span class="WHIT">			    </span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"    cps: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">aCP</span><span class="PUNC">[</span><span class="NAME">j</span><span class="PUNC">]</span><span class="PUNC">.</span><span class="NAME">cps</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1063</span> </span><span class="WHIT">		    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1064</span> </span><span class="WHIT">		</span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1065</span> </span><span class="WHIT">	    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1066</span> </span><span class="WHIT">        </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1067</span> 
<span class='line'>1068</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"signature algorithm: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getSignatureAlgorithmName</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1069</span> </span><span class="WHIT">	</span><span class="NAME">s</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="PUNC">=</span><span class="WHIT"> </span><span class="STRN">"signature: "</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">this.getSignatureValueHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">substr</span><span class="PUNC">(</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">16</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"...\n"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1070</span> </span><span class="WHIT">	</span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1071</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1072</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1073</span> 
<span class='line'>1074</span> </span><span class="COMM">/**
<span class='line'>1075</span>  * get distinguished name string in OpenSSL online format from hexadecimal string of ASN.1 DER X.500 name&lt;br/>
<span class='line'>1076</span>  * @name hex2dn
<span class='line'>1077</span>  * @memberOf X509
<span class='line'>1078</span>  * @function
<span class='line'>1079</span>  * @param {String} hex hexadecimal string of ASN.1 DER distinguished name
<span class='line'>1080</span>  * @param {Integer} idx index of hexadecimal string (DEFAULT=0)
<span class='line'>1081</span>  * @return {String} OpenSSL online format distinguished name
<span class='line'>1082</span>  * @description
<span class='line'>1083</span>  * This static method converts from a hexadecimal string of 
<span class='line'>1084</span>  * distinguished name (DN)
<span class='line'>1085</span>  * specified by 'hex' and 'idx' to OpenSSL oneline string representation (ex. /C=US/O=a).
<span class='line'>1086</span>  * @example
<span class='line'>1087</span>  * X509.hex2dn("3031310b3...") &rarr; /C=US/O=a/CN=b2+OU=b1
<span class='line'>1088</span>  */</span><span class="WHIT">
<span class='line'>1089</span> </span><span class="NAME">X509.hex2dn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1090</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1091</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"malformed DN"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1092</span> 
<span class='line'>1093</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1094</span> 
<span class='line'>1095</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1096</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1097</span> </span><span class="WHIT">	</span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="NAME">X509.hex2rdn</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1098</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1099</span> 
<span class='line'>1100</span> </span><span class="WHIT">    </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">a.map</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s.replace</span><span class="PUNC">(</span><span class="STRN">"/"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"\\/"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1101</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="STRN">"/"</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">a.join</span><span class="PUNC">(</span><span class="STRN">"/"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1102</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1103</span> 
<span class='line'>1104</span> </span><span class="COMM">/**
<span class='line'>1105</span>  * get relative distinguished name string in OpenSSL online format from hexadecimal string of ASN.1 DER RDN&lt;br/>
<span class='line'>1106</span>  * @name hex2rdn
<span class='line'>1107</span>  * @memberOf X509
<span class='line'>1108</span>  * @function
<span class='line'>1109</span>  * @param {String} hex hexadecimal string of ASN.1 DER concludes relative distinguished name
<span class='line'>1110</span>  * @param {Integer} idx index of hexadecimal string (DEFAULT=0)
<span class='line'>1111</span>  * @return {String} OpenSSL online format relative distinguished name
<span class='line'>1112</span>  * @description
<span class='line'>1113</span>  * This static method converts from a hexadecimal string of 
<span class='line'>1114</span>  * relative distinguished name (RDN)
<span class='line'>1115</span>  * specified by 'hex' and 'idx' to LDAP string representation (ex. O=test+CN=test).&lt;br/>
<span class='line'>1116</span>  * NOTE: Multi-valued RDN is supported since jsnrsasign 6.2.2 x509 1.1.10.
<span class='line'>1117</span>  * @example
<span class='line'>1118</span>  * X509.hex2rdn("310a3008060355040a0c0161") &rarr; O=a
<span class='line'>1119</span>  * X509.hex2rdn("31143008060355040a0c01613008060355040a0c0162") &rarr; O=a+O=b
<span class='line'>1120</span>  */</span><span class="WHIT">
<span class='line'>1121</span> </span><span class="NAME">X509.hex2rdn</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1122</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1123</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"31"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"malformed RDN"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1124</span> 
<span class='line'>1125</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1126</span> 
<span class='line'>1127</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX.getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1128</span> </span><span class="WHIT">    </span><span class="KEYW">for</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="WHIT"> </span><span class="PUNC">&lt;</span><span class="WHIT"> </span><span class="NAME">aIdx.length</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="NAME">i</span><span class="PUNC">++</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1129</span> </span><span class="WHIT">	</span><span class="NAME">a.push</span><span class="PUNC">(</span><span class="NAME">X509.hex2attrTypeValue</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NAME">i</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1130</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'>1131</span> 
<span class='line'>1132</span> </span><span class="WHIT">    </span><span class="NAME">a</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">a.map</span><span class="PUNC">(</span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">s</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">s.replace</span><span class="PUNC">(</span><span class="STRN">"+"</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"\\+"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT"> </span><span class="PUNC">}</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1133</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">a.join</span><span class="PUNC">(</span><span class="STRN">"+"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1134</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1135</span> 
<span class='line'>1136</span> </span><span class="COMM">/**
<span class='line'>1137</span>  * get string from hexadecimal string of ASN.1 DER AttributeTypeAndValue&lt;br/>
<span class='line'>1138</span>  * @name hex2attrTypeValue
<span class='line'>1139</span>  * @memberOf X509
<span class='line'>1140</span>  * @function
<span class='line'>1141</span>  * @param {String} hex hexadecimal string of ASN.1 DER concludes AttributeTypeAndValue
<span class='line'>1142</span>  * @param {Integer} idx index of hexadecimal string (DEFAULT=0)
<span class='line'>1143</span>  * @return {String} string representation of AttributeTypeAndValue (ex. C=US)
<span class='line'>1144</span>  * @description
<span class='line'>1145</span>  * This static method converts from a hexadecimal string of AttributeTypeAndValue
<span class='line'>1146</span>  * specified by 'hex' and 'idx' to LDAP string representation (ex. C=US).
<span class='line'>1147</span>  * @example
<span class='line'>1148</span>  * X509.hex2attrTypeValue("3008060355040a0c0161") &rarr; O=a
<span class='line'>1149</span>  * X509.hex2attrTypeValue("300806035504060c0161") &rarr; C=a
<span class='line'>1150</span>  * X509.hex2attrTypeValue("...3008060355040a0c0161...", 128) &rarr; O=a
<span class='line'>1151</span>  */</span><span class="WHIT">
<span class='line'>1152</span> </span><span class="NAME">X509.hex2attrTypeValue</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1153</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1154</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1155</span> 
<span class='line'>1156</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="NAME">undefined</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1157</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">idx</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"30"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="KEYW">throw</span><span class="WHIT"> </span><span class="STRN">"malformed attribute type and value"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1158</span> 
<span class='line'>1159</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getChildIdx</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">idx</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1160</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">aIdx.length</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="WHIT"> </span><span class="PUNC">||</span><span class="WHIT"> </span><span class="NAME">hex.substr</span><span class="PUNC">(</span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">2</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">!==</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'>1161</span> </span><span class="WHIT">	</span><span class="STRN">"malformed attribute type and value"</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1162</span> 
<span class='line'>1163</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oidHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1164</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">oidInt</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.ASN1Util.oidHexToInt</span><span class="PUNC">(</span><span class="NAME">oidHex</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1165</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">atype</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">KJUR.asn1.x509.OID.oid2atype</span><span class="PUNC">(</span><span class="NAME">oidInt</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1166</span> 
<span class='line'>1167</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">hV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getV</span><span class="PUNC">(</span><span class="NAME">hex</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">aIdx</span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1168</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">rawV</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">hextorstr</span><span class="PUNC">(</span><span class="NAME">hV</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1169</span> 
<span class='line'>1170</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">atype</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="STRN">"="</span><span class="WHIT"> </span><span class="PUNC">+</span><span class="WHIT"> </span><span class="NAME">rawV</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1171</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1172</span> 
<span class='line'>1173</span> </span><span class="COMM">/**
<span class='line'>1174</span>  * get RSA/DSA/ECDSA public key object from X.509 certificate hexadecimal string&lt;br/>
<span class='line'>1175</span>  * @name getPublicKeyFromCertHex
<span class='line'>1176</span>  * @memberOf X509
<span class='line'>1177</span>  * @function
<span class='line'>1178</span>  * @param {String} h hexadecimal string of X.509 certificate for RSA/ECDSA/DSA public key
<span class='line'>1179</span>  * @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key
<span class='line'>1180</span>  * @since jsrasign 7.1.0 x509 1.1.11
<span class='line'>1181</span>  */</span><span class="WHIT">
<span class='line'>1182</span> </span><span class="NAME">X509.getPublicKeyFromCertHex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1183</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1184</span> </span><span class="WHIT">    </span><span class="NAME">x.readCertHex</span><span class="PUNC">(</span><span class="NAME">h</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1185</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">x.getPublicKey</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1186</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1187</span> 
<span class='line'>1188</span> </span><span class="COMM">/**
<span class='line'>1189</span>  * get RSA/DSA/ECDSA public key object from PEM certificate string
<span class='line'>1190</span>  * @name getPublicKeyFromCertPEM
<span class='line'>1191</span>  * @memberOf X509
<span class='line'>1192</span>  * @function
<span class='line'>1193</span>  * @param {String} sCertPEM PEM formatted RSA/ECDSA/DSA X.509 certificate
<span class='line'>1194</span>  * @return returns RSAKey/KJUR.crypto.{ECDSA,DSA} object of public key
<span class='line'>1195</span>  * @since x509 1.1.1
<span class='line'>1196</span>  * @description
<span class='line'>1197</span>  * NOTE: DSA is also supported since x509 1.1.2.
<span class='line'>1198</span>  */</span><span class="WHIT">
<span class='line'>1199</span> </span><span class="NAME">X509.getPublicKeyFromCertPEM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sCertPEM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1200</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1201</span> </span><span class="WHIT">    </span><span class="NAME">x.readCertPEM</span><span class="PUNC">(</span><span class="NAME">sCertPEM</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1202</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">x.getPublicKey</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1203</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1204</span> 
<span class='line'>1205</span> </span><span class="COMM">/**
<span class='line'>1206</span>  * get public key information from PEM certificate
<span class='line'>1207</span>  * @name getPublicKeyInfoPropOfCertPEM
<span class='line'>1208</span>  * @memberOf X509
<span class='line'>1209</span>  * @function
<span class='line'>1210</span>  * @param {String} sCertPEM string of PEM formatted certificate
<span class='line'>1211</span>  * @return {Hash} hash of information for public key
<span class='line'>1212</span>  * @since x509 1.1.1
<span class='line'>1213</span>  * @description
<span class='line'>1214</span>  * Resulted associative array has following properties:&lt;br/>
<span class='line'>1215</span>  * &lt;ul>
<span class='line'>1216</span>  * &lt;li>algoid - hexadecimal string of OID of asymmetric key algorithm&lt;/li>
<span class='line'>1217</span>  * &lt;li>algparam - hexadecimal string of OID of ECC curve name or null&lt;/li>
<span class='line'>1218</span>  * &lt;li>keyhex - hexadecimal string of key in the certificate&lt;/li>
<span class='line'>1219</span>  * &lt;/ul>
<span class='line'>1220</span>  * NOTE: X509v1 certificate is also supported since x509.js 1.1.9.
<span class='line'>1221</span>  */</span><span class="WHIT">
<span class='line'>1222</span> </span><span class="NAME">X509.getPublicKeyInfoPropOfCertPEM</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="PUNC">(</span><span class="NAME">sCertPEM</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'>1223</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">ASN1HEX</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1224</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_ASN1HEX.getVbyList</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1225</span> 
<span class='line'>1226</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">result</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1227</span> </span><span class="WHIT">    </span><span class="KEYW">var</span><span class="WHIT"> </span><span class="NAME">x</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">hSPKI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NAME">pubkey</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1228</span> </span><span class="WHIT">    </span><span class="NAME">result.algparam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">null</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1229</span> 
<span class='line'>1230</span> </span><span class="WHIT">    </span><span class="NAME">x</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">X509</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1231</span> </span><span class="WHIT">    </span><span class="NAME">x.readCertPEM</span><span class="PUNC">(</span><span class="NAME">sCertPEM</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1232</span> 
<span class='line'>1233</span> </span><span class="WHIT">    </span><span class="NAME">hSPKI</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">x.getPublicKeyHex</span><span class="PUNC">(</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1234</span> </span><span class="WHIT">    </span><span class="NAME">result.keyhex</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">hSPKI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"03"</span><span class="PUNC">)</span><span class="PUNC">.</span><span class="NAME">substr</span><span class="PUNC">(</span><span class="NUMB">2</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1235</span> </span><span class="WHIT">    </span><span class="NAME">result.algoid</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">hSPKI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1236</span> 
<span class='line'>1237</span> </span><span class="WHIT">    </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">result.algoid</span><span class="WHIT"> </span><span class="PUNC">===</span><span class="WHIT"> </span><span class="STRN">"2a8648ce3d0201"</span><span class="PUNC">)</span><span class="WHIT"> </span><span class="PUNC">{</span><span class="WHIT"> </span><span class="COMM">// ecPublicKey</span><span class="WHIT">
<span class='line'>1238</span> </span><span class="WHIT">	</span><span class="NAME">result.algparam</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NAME">_getVbyList</span><span class="PUNC">(</span><span class="NAME">hSPKI</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="NUMB">0</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">]</span><span class="PUNC">,</span><span class="WHIT"> </span><span class="STRN">"06"</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1239</span> </span><span class="WHIT">    </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1240</span> 
<span class='line'>1241</span> </span><span class="WHIT">    </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">result</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1242</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1243</span> 
<span class='line'>1244</span> </span><span class="COMM">/* ======================================================================
<span class='line'>1245</span>  *   Specific V3 Extensions
<span class='line'>1246</span>  * ====================================================================== */</span><span class="WHIT">
<span class='line'>1247</span> 
<span class='line'>1248</span> </span><span class="NAME">X509.KEYUSAGE_NAME</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="PUNC">[</span><span class="WHIT">
<span class='line'>1249</span> </span><span class="WHIT">    </span><span class="STRN">"digitalSignature"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1250</span> </span><span class="WHIT">    </span><span class="STRN">"nonRepudiation"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1251</span> </span><span class="WHIT">    </span><span class="STRN">"keyEncipherment"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1252</span> </span><span class="WHIT">    </span><span class="STRN">"dataEncipherment"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1253</span> </span><span class="WHIT">    </span><span class="STRN">"keyAgreement"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1254</span> </span><span class="WHIT">    </span><span class="STRN">"keyCertSign"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1255</span> </span><span class="WHIT">    </span><span class="STRN">"cRLSign"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1256</span> </span><span class="WHIT">    </span><span class="STRN">"encipherOnly"</span><span class="PUNC">,</span><span class="WHIT">
<span class='line'>1257</span> </span><span class="WHIT">    </span><span class="STRN">"decipherOnly"</span><span class="WHIT">
<span class='line'>1258</span> </span><span class="PUNC">]</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'>1259</span> </span></pre></body></html>